package com.amos.boot.web;

import com.amos.boot.annotation.MethodStringBlankNull;
import com.amos.boot.request.HelloForm;
import org.springframework.web.bind.annotation.*;

/**
 * PROJECT: boot
 * DESCRIPTION: note
 *
 * @author Daoyuan
 * @date 2019/1/17
 */
@RestController
@RequestMapping("boot")
public class BootController {

    @PostMapping("hello")
    @MethodStringBlankNull
    public String hello(@RequestBody HelloForm helloForm) {

        return helloForm.toString();
    }

    @PostMapping("hello2")
    @MethodStringBlankNull(convert = MethodStringBlankNull.Convert.NULL_2_BLANK)
    public String hello2(@RequestBody HelloForm helloForm) {

        return helloForm.toString();
    }

    @GetMapping("hello")
    @MethodStringBlankNull
    public String hello(String name) {
        return name;
    }

}
